import Vue from "vue";
import Router from "vue-router";
// import HelloWorld from "@/components/HelloWorld";
import Home from "./../components/home/home.vue";
// import comfirm from "./../components/home/comfirmInput.vue";


//

Vue.use(Router);

export default new Router({
  routes: [
     {
      path: "/",
      redirect:"/home"
    }, 
     {
      path: "/home",
      name:"home",
      component: Home
    }, 
    {
      path: "/home/comfirm",
      name:"comfirm",
      component: function(resolve) {
        require(["./../components/home/comfirmInput.vue"], resolve);
      }
      // component:comfirm
    }, 
    {
      path: "/hello",
      name: "HelloWorld",
      // component: HelloWorld,
      // childComonent: function(resolve) {
      //   require(["./../components/home/comfirmInput.vue"], resolve);
      // },
      component: function(resolve) {//异步加载组价,需要注意不能import本组件,不然就不会加载异步
        require(["./../components/HelloWorld.vue"], resolve);
      }
      
    },
   
   
  ]
});
